<!--
  Copyright 2015, Red Hat, Inc. and individual contributors
  as indicated by the @author tags. See the copyright.txt file in the
  distribution for a full listing of individual contributors.

  This is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation; either version 2.1 of
  the License, or (at your option) any later version.

  This software is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this software; if not, write to the Free
  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:composite="http://java.sun.com/jsf/composite"
  xmlns:h="http://java.sun.com/jsf/html">

<composite:interface
  shortDescription="Avatar image and username for a person, that links to their profile.">
  <composite:attribute name="person" type="org.zanata.model.HPerson"
      shortDescription="Person to display"/>

  <composite:attribute name="styleClass" type="java.lang.String"
    shortDescription="css style for wrapper of a href"/>
</composite:interface>

<composite:implementation>
  <a id="#{cc.clientId}" class="#{cc.attrs.styleClass}"
    href="#{request.contextPath}/profile/view/#{cc.attrs.person.account.username}#{dswidQuery}">
    <span class="w--r-1 bx--round l--push-right-quarter">
      <img src="#{gravatarServiceImpl.getUserImageUrl(48, cc.attrs.person.email)}" alt=""/>
    </span>
    <h:outputText value="#{cc.attrs.person.account.username}"/>
  </a>
</composite:implementation>

</html>
